home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / math / txtab605.zip / TXTABLE.DOC < prev    next >
Text File  |  1996-05-19  |  24KB  |  503 lines

  1. TXTABLE.DOC                          1                         Revised: 05/19/96
  2.  
  3. This program creates tables from an ASCII text input file.  Easier  to  maintain
  4. than most word processing tables, the program  automatically  handles  alignment
  5. and such.  Features:
  6.  
  7.   * Creates tables which can be (at this point) up to 10 columns wide.
  8.   * Automatically sets table column widths but you can override this.
  9.   * Allows flexibility in terms of alignment, borders, titles, and
  10.     page lengths.
  11.   * You can either use a straight ASCII text input file (typically one
  12.     record per cell) or else a pseudo-HTML input file
  13.   * If you use the optional imbedded HTML stuff, you can have more than one
  14.     table per input file.
  15.  
  16.  
  17. The TXTABLE.EXE input file:
  18.  
  19. TXTABLE.EXE works off an ASCII text input file which  basically  tells  it  what
  20. goes in each cell.  This file can be created and maintained by hand.
  21.  
  22. (A sample file, TXTABLE2.SAM, should have been included in the ZIP  file.   It's
  23. used as the basis of the example shown below.  Feel free to  try  it  out  using
  24. "TXTABLE TXTABLE2.SAM".)
  25.  
  26. Tables can be indicated in this file in one of two ways.  The first is a  method
  27. which doesn't use HTML commands and basically expects one cell of data per  line
  28. on input.  The second method is based on a limited version of  the  HTML  coding
  29. for tables.
  30.  
  31. You will notice that the sample file actually mixes the two  techniques  in  the
  32. same file.  If this is done, the  HTML-based  table(s)  must  appear  after  the
  33. one-line/one-cell model.
  34.  
  35.  
  36. Using format one (non-HTML):
  37.  
  38. Each record in the input file is the contents of a single cell.  Long lines  are
  39. automatically wrapped on output by the program.  For  example,  if  you  have  a
  40. table that looks like this:
  41.  
  42. ╔═════════════╦══════════════════╤═════════════════════════════════════════════╗
  43. ║  Character  ║  Actor/Actress   │                  Viewpoint                  ║
  44. ╠═════════════╬══════════════════╪═════════════════════════════════════════════╣
  45. ║ Fox Mulder  ║ David Duchovny   │ Searching for the truth about his sister.   ║
  46. ║             ║                  │ Conspiracy under every rock.                ║
  47. ╟─────────────╫──────────────────┼─────────────────────────────────────────────╢
  48. ║ Dana Scully ║ Gillian Anderson │ Science is god.  However, strong religious  ║
  49. ║             ║                  │ beliefs provide second foundation.          ║
  50. ╚═════════════╩══════════════════╧═════════════════════════════════════════════╝
  51.  
  52. (This table was generated by the TXTABLE command.)
  53.  
  54.  
  55. TXTABLE.DOC                          2                         Revised: 05/19/96
  56.  
  57. The input file would consist of the nine cells shown above, in  the  order  they
  58. are shown.  In this case, the input file was the following:
  59.  
  60.   Character
  61.   Actor/Actress
  62.   Viewpoint
  63.   Fox Mulder
  64.   David Duchovny
  65.   Searching for the truth about his sister.  Conspiracy under every rock.
  66.   Dana Scully
  67.   Gillian Anderson
  68.   Science is god.  However, strong religious beliefs provide second foundation.
  69.  
  70. Leading spaces are removed by the program for data lines.
  71.  
  72. You can embed comment lines within the input file.  Comments are any lines  that
  73. begin with a colon (":"), semicolon (";"), or slash-asterisk pair ("/*").  These
  74. special characters have to begin in column 1.   The  typical  use  for  comments
  75. would be to indicate where table lines begin and what parameters  are  suggested
  76. for this table.  For example, a commented input file for this example  might  be
  77. the following:
  78.  
  79.   /* TXTABLE2.SAM
  80.   Character
  81.   Actor/Actress
  82.   Viewpoint
  83.   /*
  84.   Fox Mulder
  85.   David Duchovny
  86.   Searching for the truth about his sister.  Conspiracy under every rock.
  87.   /*
  88.   Dana Scully
  89.   Gillian Anderson
  90.   Science is god.  However, strong religious beliefs provide second foundation.
  91.  
  92. One advantage of this approach is that it  makes  it  very  easy  to  move  rows
  93. around, something which I could never figure out how to do in WordPerfect.
  94.  
  95. A blank line means an empty cell.
  96.  
  97. The  cell  contents  can  include  embedded  decimal  and  hexadecimal   strings
  98. (including space representations) if desired (see BRUCEHEX.DOC  file).   If  you
  99. want to force a new line within a cell (e.g.  "Actor/" and then  have  "Actress"
  100. on the next line), include the  representation  of  a  carriage  return/linefeed
  101. within the line.  For example:  Actor/\013\010Actress.
  102.  
  103. If you have a very long cell, you can split the line in  your  input  file  into
  104. multiple lines.   To  do  this,  end  the  line(s)  to  be  continued  with  the
  105. continuation indicator, which initially defaults to "__".  For example,
  106.  
  107.         This cell consists of a number of words__
  108.           so it's been split into multiple lines to make it easier__
  109.           to read in the input file.
  110.  
  111. Leading spaces are ignored by the program (except for comments)  and  it's  much
  112. easier to read the lines if you indent the continued lines.
  113.  
  114.  
  115. TXTABLE.DOC                          3                         Revised: 05/19/96
  116.  
  117. Line continuations in the input file has no bearing on where the cells  will  be
  118. wrapped in the final table.  That's based exclusively on  cell  widths  and  the
  119. \013\010 indicators.
  120.  
  121. Note that the program automatically adds one  space  when  it  joins  the  lines
  122. unless a space is already there.  So the above example will have the cell  shown
  123. based on "words so" and "easier to".
  124.  
  125.  
  126. Parts of a table and their alignment:
  127.  
  128. Each table consists of a header section (the first line of  cells)  and  a  stub
  129. (the left-most column of cells).  The contents of the cells within each of these
  130. sections can be positioned  independently  from  the  body  of  the  table.   By
  131. default, the contents of the headers are centered,  then  the  stubs  are  flush
  132. left, and then body of the table is also flush left.  The uppermost left cell is
  133. considered to be part of the header, not the stub.
  134.  
  135. Numeric values are  positioned  totally  independent  of  everything  else.   By
  136. default, they are positioned flush right.  At this point,  the  program  doesn't
  137. support decimal alignment so just make sure you have the same number of  decimal
  138. places for every cell in the column.
  139.  
  140. In addition, you can have an optional title in your table.  The title can be  as
  141. long as you want it; it will be automatically wrapped and centered based on your
  142. page width.  Note that the only way to have a title is to embed it in your input
  143. file.  This is explained shortly in the "Specifying parameters" section.
  144.  
  145.  
  146.  
  147. TXTABLE.DOC                          4                         Revised: 05/19/96
  148.  
  149. Using format two (HTML based):
  150.  
  151. The second format for the input file is based on the HTML standard.  Having said
  152. this, it does *not* the HTML standard; just a subset of it.
  153.  
  154. HTML uses indicators enclosed in "<..>" characters to indicate what's to happen.
  155. Unlike the HTMSTRIP command (also released by freeware by this author),  TXTABLE
  156. only supports certain HTML codes:
  157.  
  158.         <BR>                    Line is to be split at this point
  159.         <CAPTION>..</CAPTION>   Title of table (<TITLE>..</TITLE> works too)
  160.         <TABLE>..</TABLE>       Table definition
  161.         <TD>..</TD>             Table cell data contents
  162.         <TH>..</TH>             Table header data contents
  163.         <HR>                    Horizontal rule is to appear here
  164.         <TITLE>..</TITLE>       Title of table (<CAPTION>..</CAPTION> works too)
  165.         <TR>..</TR>             Table row
  166.         <VERBATIM>..</VERBATIM> Block which follows appears outside of a
  167.                                 table block and is to be printed verbatim.
  168.  
  169. A typical table looks like the following:
  170.  
  171.         <TABLE>
  172.         <CAPTION>Main exports by country</CAPTION>
  173.         <TR><TH>Table stub</TH><TH>Col 1</TH><TH>Col 2</TH></TR>
  174.         <TR><TD>China</TD>
  175.             <TD>Textiles</TD>
  176.             <TD>Apparel</TD></TR>
  177.         <TR><TD>Japan</TD>
  178.             <TD>Automobiles</TD>
  179.             <TD>Electronics</TD></TR>
  180.         </TABLE>
  181.  
  182. This input file would result in the following output:
  183.  
  184.